<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport"
          content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
    <meta name="format-detection" content="telephone=no"/>
    <title>提现</title>
    <link rel="stylesheet" type="text/css" href="../../css/aui.css"/>
    <link rel="stylesheet" type="text/css" href="../../css/style.css"/>
    <link rel="stylesheet" type="text/css" href="../../css/common.css"/>
    <style>
        body {
            background: #f3f3f3;
            font-size: 14px;
        }

        footer.aui-nav {
            z-index: 99999;
        }

        header.aui-bar {
            background: #fff;
        }

        .aui-title {
            color: #000;
        }

        .contain {
            position: relative;
            margin-bottom: 70px;
        }

        .menuRgiht {
            float: right;
            margin-right: 20px;
        }

        #scroller {
            width: 100%;
        }

        .aui-list-view {
            overflow: hidden;
        }

        .aui-list-view:after {
            border: none;
        }

        textarea {
            padding: 2px 8px;
            border: none;
            height: 80px;
            overflow-y: auto;
            margin-top: 5px;
        }

        .aui-list-view i.aui-iconfont {
            color: #000;
        }

        /*下面弹出的样式*/
        .pickerToTop {
            position: fixed;
            bottom: 0;
            -webkit-transform: translateY(143px);
            height: 143px;
            overflow-y: auto;
            -webkit-transition: .5s;
            transition: .5s;
            z-index: 999;
            width: 100%;
            text-align: center;
        }

        .toTopAnimate {
            -webkit-transform: translateY(00px);
        }

        .myBorder {
            height: 8px;
            background: #797979;
        }

        input[type="text"], input[type="number"] {
            line-height: 25px;
            margin: 0;
            width: inherit;
            padding: 0;
            border: 0;
        }

        .bank {
            display: none;
        }
    </style>
</head>
<body>
<header class="aui-bar aui-bar-nav aui-border-b" style="margin-bottom: 15px;">
    <div class="aui-pull-left aui-iconfont aui-icon-left icon-left-coler" tapmode onclick="closeWin()"></div>
    <div class="aui-title">提现</div>
</header>
<div class="contain">
    <ul class="aui-list-view">
        <li class="aui-list-view-cell" data-type="proType" tapmode onclick="setTixianType()">
            <a class="aui-arrow-right">
                提现方式
                <span class="menuRgiht tixianType">支付宝</span>
            </a>
        </li>
    </ul>
    <ul class="aui-list-view">
        <li class="aui-list-view-cell alipay">
            <span>支付宝号</span>
            <input type="text" id="aliNumber" placeholder="请输入您的账号" value="">
        </li>
        <li class="aui-list-view-cell bank">
            <span>开户银行</span>
            <input type="text" id="bank" placeholder="请输入您的开户银行" value="">
        </li>
        <li class="aui-list-view-cell bank">
            <span>开户支行</span>
            <input type="text" id="branch" placeholder="请输入您的开户支行" value="">
        </li>
        <li class="aui-list-view-cell bank">
            <span>银行卡号</span>
            <input type="number" id="bankNumber" placeholder="请输入您的银行卡号" value="">
        </li>
        <li class="aui-list-view-cell">
            <span>真实姓名</span>
            <input type="text" id="realName" placeholder="请输入您的姓名" value="">
        </li>
        <li class="aui-list-view-cell">
            <span>提现金额</span>
            <input type="number" id="amount" placeholder="请输入您要提现的金额" value="">
        </li>
    </ul>
    <div class="myBtn" onclick="applyDeposit()">确认转出</div>
</div>
<!-- <footer class="aui-nav">
    <div class="myBtn">确认发布</div>
</footer> -->
<input type="hidden" id="presentManner" value="1">
</body>
<script type="text/javascript" src="../../script/api.js"></script>
<script type="text/javascript" src="../../script/common.js"></script>
<script type="text/javascript" src="../../script/doT.min.js"></script>
<script type="text/javascript" src="../../script/jquery-1.11.3.js"></script>
<script type="text/javascript" src="../../script/mui.js"></script>
<script type="text/javascript">
    apiready = function () {
        api.parseTapmode();
        getStorageAll();

        var header = $api.dom('header');
        $api.fixIos7Bar(header);
    }
    function setTixianType() {
        $('#aliNumber').val('');
        $('#bankNumber').val('');
        api.actionSheet({
            title: "设置提现方式",
            buttons: ["提现到支付宝", "提现到银行卡"]
        }, function (ret, err) {
            if (ret.buttonIndex == 1) {
                $(".tixianType").text("提现到支付宝");
                $(".alipay").css({"display": "block"})
                $(".bank").css({"display": "none"})
            } else if (ret.buttonIndex == 2) {
                $(".tixianType").text("提现到银行卡");
                $(".alipay").css({"display": "none"})
                $(".bank").css({"display": "block"})
            }
        })
    }
    //提交数据库
    function applyDeposit() {
        var bankNumber = $('#aliNumber').val();
        var realName = $('#realName').val();
        var amount = $('#amount').val();
        if (bankNumber != '') {
            data = {
                userName: user_name,
                bankType: 1,
                bankNumber: bankNumber,
                realName: realName,
                amount: amount,
            };

        } else {
            var bankNumber = $('#bankNumber').val();
            var bank = $('#bank').val();
            var branch = $('#branch').val();
            data = {
                userName: user_name,
                bankType: 2,
                bank: bank,
                branch: branch,
                bankNumber: bankNumber,
                realName: realName,
                amount: amount,
            };
        }
        showLoading();
        var url = 'User/applyDeposit';
        ajaxRequest(url, 'post', data, function (ret, err) {
            if (ret.status == 1) {
                api.toast({
                    msg: '提现成功',
                    duration: 2000,
                    location: 'bottom'
                });
            } else {
                api.toast({
                    msg: '提现失败',
                    duration: 2000,
                    location: 'bottom'
                });
            }
        });
        hideLoading();
    }
</script>
</html>
